]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
userWidget: Respect the scale factor in the bin size we set
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 6 Oct 2014 23:07:32 +0000 (16:07 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 7 Oct 2014 00:02:04 +0000 (17:02 -0700)
Otherwise, the widget will be too small on hi-DPI devices.

Based on a patch by: Darcy Beurle <darcy@beurle.id.au>

https://bugzilla.gnome.org/show_bug.cgi?id=735419

js/ui/userWidget.js

index b16f9e336dc657997c0cf685488b95371eb2ec65..314aae0cea15272081429472c58b2843b723841c 100644 (file)
@@ -28,11 +28,12 @@ const Avatar = new Lang.Class({
                                         styleClass: 'framed-user-icon' });
         this._iconSize = params.iconSize;
 
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
         this.actor = new St.Bin({ style_class: params.styleClass,
                                   track_hover: params.reactive,
                                   reactive: params.reactive,
-                                  width: this._iconSize,
-                                  height: this._iconSize });
+                                  width: this._iconSize * scaleFactor,
+                                  height: this._iconSize * scaleFactor });
     },
 
     setSensitive: function(sensitive) {